package edu.nf.ch02.service;

import edu.nf.ch02.entity.User;
import edu.nf.ch02.mapper.UserMapper;
import edu.nf.ch02.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

/**
 * @author wangl
 * @date 2025/4/23
 */
public class UserService {

    public void save(User user) {
        try(SqlSession session = MybatisUtils.getSqlSession()) {
            UserMapper proxy = session.getMapper(UserMapper.class);
            proxy.save(user);
        }
    }
}